package com.lavida.project.system.goods.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.lavida.project.system.goods.domain.SubGoods;

import net.sf.jsqlparser.statement.delete.Delete;

public interface SubGoodsMapper {
	
	List<SubGoods> selectById(int id);
	
	/**
	 * 获取指定操作的数量
	 * @param branchOffice
	 * @param deptName
	 * @param operateType
	 * @param subId
	 * @return
	 */
	@Select("SELECT amount FROM subgoods WHERE fen_company=#{branchOffice} AND dept=#{deptName} AND operatetype=#{operateType} AND subId=#{subId}")
	public Integer selectOperateAmount(@Param("branchOffice")String branchOffice,@Param("deptName")String deptName,@Param("operateType")String operateType,@Param("subId")Integer subId);
	
	int insertSubGoods(SubGoods subGoods);
	
	int deleteSubgoods(int id); 
	
	void deleteSubgoodsById(int id);
	
	int updateSubgoods(SubGoods subGoods); 
	
	SubGoods getSubgoods(int id); 
	
	
}
